package java复习202407;

import org.junit.jupiter.api.Test;

public class c7_位运算验证 {

    /**
     * 0000 0
     * 0001 1
     * 0010 2
     * 0011 3
     * 0100 4
     * 0101 5
     * 1000 8
     * 0011 3 0001 => 0001 1
     * 0011 3 0010 => 0010 2
     * 0011 3 0011 => 0011 3
     * 0011 3 0100 => 0000 0
     * 0011 3 0101 => 0001 1
     * 0100 4 0001 => 0000
     * 0100 4 0010 => 0000
     * 0100 4 0011 => 0000
     * 0100 4 0100 => 0100
     * 0100 4 0101 => 0100
     */

    @Test
    public void 位与运算验证(){
        System.out.println(4 & 0);
        System.out.println(4 & 1);
        System.out.println(4 & 2);
        System.out.println(4 & 3);
        System.out.println(4 & 4);
        System.out.println(4 & 5);
        System.out.println(4 & 6);
        System.out.println(4 & 7);
        System.out.println(4 & 8);
        System.out.println(4 & 9);
    }

    @Test
    public void 位移运算验证(){
        System.out.println(1 << 30);
    }

}
